<?php
abstract class Employee
{
    protected $name;
    function __construct($name)
    {
        $this->name = $name;
    }
    abstract function fire();
}
//奴才
class Minion extends Employee
{
    function fire()
    {

        print "$this->name i'll clear my desk";
    }
}
class NastyBoss
{
    private $employee = array();
    function addEmployee($employeeName)
    {
        $this->employee[] = new Minion($employeeName);
        //为什么受到限制
    }
    function projectFails()
    {
        if (count($this->employee) > 0) {
            $emp = array_pop($this->employee);
            $emp->fire();
        }
    }
}
class CluedUp extends Employee{
     function fire(){
        print "";
     }
}
class WellConnected extends Employee{
     function fire(){
        print "$this->name'll call you dad";
     }
}
$boss = new NastyBoss();
$boss->addEmployee("a");
$boss->addEmployee("b");
$boss->addEmployee("c");
$boss->projectFails();
$boss->projectFails();
?>